package jni;

import com.sun.jna.Library;
import com.sun.jna.Native;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ilongsay
 * @date: Create in 2019/11/27 16:50
 * @description: don't bb,show you code
 */
public class JnaTest2 {
    public interface TestProject extends Library {
        TestProject INSTANCE = Native.load("src/main/lib/libtestProject.dll", TestProject.class);
        public double add(double i, double j);
        public double mul(double i, double j);
        public String getString(String a);

    }

    public class TestLoadDll{
        {
            Native.register("src/main/lib/libtestProject.dll");
        }
        public native double add(double i, double j);
    }

    public static void main(String[] args) {
        TestLoadDll dll = new JnaTest2().new TestLoadDll();
        System.out.println(dll.add(20, 11));
//        System.out.println(TestProject.INSTANCE.add(20.11,20.0));
//        System.out.println(TestProject.INSTANCE.mul(16.9,20.89));
//        System.out.println(TestProject.INSTANCE.getString("你是大帅哥 "));
    }
}
